package com.goukakuproject;

import com.leftMenuHelper.Lession;
import com.leftMenuHelper.LessionAdapter;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

public class GKGrammartab extends Activity {

	private ListView listViewGrammer;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_gkgrammartab);
		Lession lessonData[] = new Lession[10];       
        for (int i = 0; i< 10; i++){
        	lessonData[i] =  new Lession(R.drawable.ic_launcher, "Ngu phap " + (i+1));
        }        
         LessionAdapter adapter = new LessionAdapter(this,R.layout.listview_item_row, lessonData);               
         listViewGrammer = (ListView)findViewById(R.id.listViewGrammer);         
//         View header = (View)getLayoutInflater().inflate(R.layout.listview_header_row, null);         
//         listViewVocab.addHeaderView(header);        
         listViewGrammer.setAdapter(adapter);         
         listViewGrammer.setOnItemClickListener(new AdapterView.OnItemClickListener() {			
			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				// TODO Auto-generated method stub				
					 Intent myIntent=new Intent(GKGrammartab.this,GKGrammardetail.class);		 
//					 Bundle bundle=new Bundle();
//					 bundle.putInt("N", bai);
//					 bundle.putInt("Bai", arg2);
					 //myIntent.putExtra("GKLeftmenu", bundle);
					 startActivity(myIntent);				
			}
			
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.gkgrammartab, menu);
		return true;
	}

}
